Code Smells
When we work on an application and write codes for it, we see a few patterns that are needed to be refactored. Those patterns either duplicates, or might make code dependent on other code. Such patterns are called Code Smells and detection of such code is called Code Smelling.
Code Smells are not the bugs of the program. With code smells too, your program might work just fine. They do not prevent the program from functioning or are incorrect. They just signify the weakness in design and might increase the risk of bugs and program failure in the future.
Types of Code Smells
Although there are more than a hundred of code smells. The list of the most common and the most repeating code smells are given below. These are broadly divided into 2 main categories.
- Within Classes
- Between Classes